<template>
  <el-form-item label="链接地址">
    <div class="custom-link-param" v-if="editorForm.link[`value${editorForm.link.type}`]">
      参数：{{ editorForm.link[`value${editorForm.link.type}`] }}
    </div>
    <div class="custom-after">
      <el-button type="primary" size="small" link @click="handleSetLink">添加链接</el-button>
    </div>
    <!-- 设置链接 -->
    <LinkEditor v-if="linkEditorShow" v-model:show="linkEditorShow" @confirm="backUpdate" />
  </el-form-item>
</template>

<script setup>
import { inject, ref } from 'vue'

const { editorForm, backUpdate } = inject('commonForm')
const linkEditorShow = ref(false)
const handleSetLink = () => {
  linkEditorShow.value = true
}
</script>

<style lang="scss" scoped>
.custom-link-param {
  color: #606266;
  font-size: 12px;
}
</style>
